package cn.crc.sysinfo;

import java.io.IOException;
import java.net.InetAddress;

/**
 * 网络工具
 */
public class NetTool {
    public static void main(String[] args) throws IOException {
        String str1="192.168.0.31";
        String[] command1 = { "netsh", "interface", "ipv4", "set", "address",
                "name=以太网", "source=static", "address="+str1};
        Process pp = Runtime.getRuntime().exec(command1);
        InetAddress net= InetAddress.getLocalHost();
        System.out.println("本机的ip是 ："+net.getHostAddress());
    }
}
